package com.kk.iterator;

import java.util.Iterator;

public class ComputerCollege implements College {

    private Department[] departments;

    private int counter;

    public ComputerCollege() {
        departments = new Department[3];
        addDepartment("计算机专业", "计算机");
        addDepartment("计算机专业2", "计算机计算机2");
        addDepartment("计算机专业3", "计算机计算机计算机3");
    }

    @Override
    public String getName() {
        return "计算机学院";
    }

    @Override
    public void addDepartment(String name, String des) {
        Department department = new Department(name, des);
        departments[counter] = department;
        counter++;
    }

    @Override
    public Iterator createIerator() {
        return new ComputerCollegeIterator(departments);
    }
}
